package com.tuanzi.loan.business.service.family.impl;

import com.tuanzi.loan.business.entity.family.LoanNewAdvertCreditCard;
import com.tuanzi.loan.business.repository.family.LoanNewAdvertCreditCardRepository;
import com.tuanzi.loan.business.service.family.LoanNewAdvertCreditCardService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.repository.JPAAuditRepository;
import com.tuanzi.loan.core.service.BaseAuditServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.LoanNewAdvertCreditCardRequest;
import com.tuanzi.loan.vo.response.family.LoanNewAdvertCreditCardResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * User: liangZongXi
 * Create time: 11:58 2018/9/5
 * Description:
 */
@Debug
@Service
@Transactional
@Retryable(value = {RetryException.class})
public class LoanNewAdvertCreditCardServiceImpl extends BaseAuditServiceImpl<LoanNewAdvertCreditCard, Long> implements LoanNewAdvertCreditCardService {

    @Autowired
    private LoanNewAdvertCreditCardRepository loanNewAdvertCreditCardRepository;

    @Override
    public Page<LoanNewAdvertCreditCardResponse> list(PageSearcher<LoanNewAdvertCreditCardRequest> pageSearcher) {
        return loanNewAdvertCreditCardRepository.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
    }

    @Override
    protected JPAAuditRepository<LoanNewAdvertCreditCard, Long> getRepository() {
        return loanNewAdvertCreditCardRepository;
    }
}
